/**
 * 
 */
package reducer;

import java.io.IOException;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import util.ArrayUtil;

/**
 * @author puneet
 *
 */
public class SparseMatrixBuilderReducer extends
		Reducer<LongWritable, LongWritable, LongWritable, Text> {

	/* (non-Javadoc)
	 * @see org.apache.hadoop.mapreduce.Reducer#reduce(java.lang.Object, java.lang.Iterable, org.apache.hadoop.mapreduce.Reducer.Context)
	 */
	@Override
	protected void reduce(LongWritable key, Iterable<LongWritable> values,Context context) throws IOException, InterruptedException {
		context.write(key, new Text(ArrayUtil.joinUniqueC(values, "\t")));
	}

}
